﻿using System.ServiceModel;
using System;
using System.Collections.Generic;
using Apprenda.SaaSGrid;

namespace SaaSKit.Taskr.Service
{
    [ServiceContract(Namespace = "SaaSKit.Taskr.Service", Name = "AdminService")]
    public interface IAdminService
    {
        /// <summary>
        /// Retrieves the application settings.
        /// </summary>
        /// <returns>Returns the application settings.</returns>
        [OperationContract(Action = "urn:SaaSKit.Taskr.Service.GetSettings",
                           ReplyAction = "urn:SaaSKit.Taskr.Service.GetSettingsReply")]
        [FaultContract(typeof(ApplicationFaultDetail), Action = "urn:SaaSKit.Fault")]
        SettingsDTO GetSettings();

        /// <summary>
        /// Updates the application settings based on the specified values.
        /// </summary>
        /// <param name="settings">The new settings.</param>
        [OperationContract(Action = "urn:SaaSKit.Taskr.Service.UpdateSettingsTask",
                           ReplyAction = "urn:SaaSKit.Taskr.Service.UpdateSettingsReply")]
        [FaultContract(typeof(ApplicationFaultDetail), Action = "urn:SaaSKit.Fault")]
        [FaultContract(typeof(NotAuthorizedDetail), Action = "urn:SaaSKit.Fault")]
        void UpdateSettings(SettingsDTO settings);
    }
}
